package cn.edu.scau.cmi.chenbingquan.singleton;

// 主席类(单例)
public class Chairman {
	public static Chairman instance;
	private String name;
	
	private Chairman(String name) {
		this.name = name;
	}
	
	// 创建主席
	public static Chairman getInstance(String name) {
		if(instance == null) {
			instance = new Chairman(name);
		} 
		return instance;
	}
	
	@Override
	public String toString() {
		return "主席名称为：" + this.name ;
	}
}
